package com.example.sendsms;

import android.content.Context;
import android.view.View;
import android.widget.Checkable;
import android.widget.FrameLayout;
import android.widget.RadioButton;
import android.widget.TextView;

public class ChoiceView extends FrameLayout implements Checkable {

    private TextView tv;
    private RadioButton rb;

    public ChoiceView(Context context) {
        super(context);
        View.inflate(context,R.layout.item,this);
        tv = (TextView) findViewById(R.id.tv_item);
        rb = (RadioButton) findViewById(R.id.rb_item);
    }

    @Override
    public void setChecked(boolean checked) {
        rb.setChecked(checked);
    }

    @Override
    public boolean isChecked() {
        return rb.isChecked();
    }

    @Override
    public void toggle() {
        rb.toggle();
    }

    public void setTextView(String text){
        tv.setText(text);
    }
}
